package dao;

import entity.User;
import util.DBUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class UserDao {

    public boolean insert(User user) {
        boolean res = false;
        String sql = "insert `user`(`user`, 'password', 'email', 'name', 'phone', 'address') values(?, ?, ?, ?, ?, ?)";

        try {

            Connection conn = DBUtil.getConn();
            PreparedStatement ps = conn.prepareStatement(sql);
            ps.setLong(1, user.getUser());
            ps.setString(2, user.getPassword());
            ps.setString(3, user.getEmail());
            ps.setString(4, user.getName());
            ps.setString(5, user.getPhone());
            ps.setString(6, user.getAddress());

            
        }
    }    
}
